﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EmaillSend
{
    class LogHelper
    {
        /// <summary>
        /// 输出日志到Log4Net
        /// </summary>
        /// <param name="t"></param>
        /// <param name="ex"></param>
        #region static void ErrorLog(Exception ex)

        public static void ErrorLog(Exception ex)
        {
            log4net.ILog log = log4net.LogManager.GetLogger("LogError");
            log.Error(ex);
        }

        #endregion

        /// <summary>
        /// 输出日志到Log4Net
        /// </summary>
        /// <param name="t"></param>
        /// <param name="ex"></param>
        #region static void InfoLog(Exception ex)

        public static void InfoLog(Exception ex)
        {
            log4net.ILog log = log4net.LogManager.GetLogger("LogInfo");
            log.Info(ex);
        }

        #endregion

        /// <summary>
        /// 输出日志到Log4Net
        /// </summary>
        /// <param name="t"></param>
        /// <param name="msg"></param>
        #region static void InfoLog(string msg)

        public static void InfoLog(string msg)
        {
            log4net.ILog log = log4net.LogManager.GetLogger("LogInfo");
            log.Info(msg);
        }

        #endregion

        /// <summary>
        /// 输出日志到Log4Net
        /// </summary>
        /// <param name="t"></param>
        /// <param name="msg"></param>
        #region static void ErrorLog(string msg)

        public static void ErrorLog(string msg)
        {
            log4net.ILog log = log4net.LogManager.GetLogger("LogError");
            log.Error(msg);
        }

        #endregion
    }
}
